home *** CD-ROM | disk | FTP | other *** search
/ Publication 7 / Publication_07_1996_High-Tech_de_Side_B.d64 / lexitron (.txt) next >
Commodore BASIC  |  2023-02-26  |  4KB  |  113 lines

  1. 100 print"[147]"spc(11)"l e x i t r o n":dimar$(20,15),ar(20,15),ln(200)
  2. 110 p$="               ":fora=0to10:readq(a):next
  3. 120 fora=0to8:readd(a):next:data 0,1,5,0,7,8,6,0,3,2,4,0,-40,-39,1,41,40,39,-1
  4. 130 diml(200):data -41:printspc(3)"please wait while loading words"
  5. 140 s=54272:fora=stos+23:pokea,0:next:pokea,15:pokes+5,28:poke53280,6
  6. 150 sc=1274:cd=54272:pt=56320:bc=53281:w=15:bl=6:sb=53265:cs=15
  7. 160 z=646:a1=15:a2=14:a3=1:a4=7:a5=6:a6=1
  8. 170 gosub1160:gosub1120
  9. 180 gosub1090
  10. 190 gw=0:fora=0to19:forb=0to14:ar(a,b)=0:nextb,a:fora=0tonw:l(a)=0:next:ps=sc
  11. 200 ll=7:pokebc,w:pokez,a5:print"[147]     use joystick to choose a level"
  12. 210 pokez,a6:printspc(10)"     1";:pokez,a5:print"  2  3":ms=sc+5
  13. 220 print"   1[146]  all words spelled forwards              no diagonals"
  14. 230 print"   2[146]  forward & reversed spellings            no diagonals"
  15. 240 print"   3[146]  forward & reversed spellings            diagonals included"
  16. 250 gosub410:ifj=0then250
  17. 260 pokems+cd,a5:ms=ms-3*(j=3)*-(ms<sc+11)+3*(j=7)*-(ms>sc+5):pokems+cd,a6
  18. 270 ifj<128then250
  19. 280 print"[147][144]"spc(14)"please wait":fortd=1to1000:next
  20. 290 lv=(ms-(sc+5))/3+1:pokesb,peek(sb)and239:pokebc,bl:gosub970
  21. 300 gosub850:qf=1:t=1:gosub480:pokesb,peek(sb)or16:ti$="000000":goto390
  22. 310 rem joystick routine
  23. 320 ifrnd(1)<.003thengosub670
  24. 330 ifrnd(1)<.009thengosub540
  25. 340 gosub410:ifj=0then320
  26. 350 ifj>127thengosub430:goto320
  27. 360 pokeps,peek(ps)and127:tp=ps
  28. 370 if(peek(ps+cd)andcs)=a3thenpokeps+cd,a2
  29. 380 ps=ps+d(jand15):ifpeek(ps)<1orpeek(ps)>26thenps=tp
  30. 390 pokeps,peek(ps)or128:if(peek(ps+cd)andcs)<>a4thenpokeps+cd,a3
  31. 400 goto320
  32. 410 j=q(15-(peek(pt)and15))-128*((peek(pt)and16)=0):return
  33. 420 rem press firebutton
  34. 430 if(peek(ps+cd)andcs)=a4thenreturn
  35. 440 y=int((ps-sc)/40):x=ps-sc-y*40
  36. 450 ifar(x,y)=0thenprintp$"try another":gosub540:return
  37. 460 printp$"good answer"
  38. 470 pokeps+cd,a4:t=ar(x,y)-1:l(t)=l(t)+1
  39. 480 pokes+4,16:pokes+4,17:pokes+1,10+10*l(t)
  40. 490 fora=sc+554to(sc+554)-40*llstep-40:pokea+40,93:pokea+71,93
  41. 500 pokea,160:pokea+31,160:fortd=1to20:next:next:ifqf=1thenqf=0:return
  42. 510 gosub590:ll=ll-(ll<15):ar(x,y)=0:ifl(t)=ln(t)thengosub610
  43. 520 return
  44. 530 rem energy drain
  45. 540 pokes+4,32:pokes+4,33:pokes+1,30:fortd=1to200:next:pokes+1,15
  46. 550 fora=sc-6to(sc-6)+40*(15-ll)step40:pokea-40,93:pokea-9,93:pokea,160
  47. 560 pokea+31,160:fortd=1to20:next:next:gosub590:ll=ll-1:ifll=-1then700
  48. 570 return
  49. 580 rem clear message
  50. 590 printp$"                   ":return
  51. 600 rem got a word
  52. 610 gw=gw+1:ifgw=10then770
  53. 620 fortd=1to300:next:printp$"well done!"
  54. 630 pokes+4,32
  55. 640 pokes+4,35:fora=6to20:pokes+1,a:fortd=30to40:pokes+15,td:next:next
  56. 650 gosub590:return
  57. 660 rem give a clue
  58. 670 a=rnd(1)*10:ifl(a)=0thenprintp$"clue:"w$(a+m):fort=1to800:next
  59. 680 gosub590:return
  60. 690 rem end of game
  61. 700 print"[144]":fora=0to14:print:printspc(10);:forb=0to19
  62. 710 ifar(b,a)<>0thenprintar$(b,a);:goto730
  63. 720 print"";
  64. 730 next:next:print:pokez,a4:print "      press firebutton to continue"
  65. 740 gosub410:ifj<128then740
  66. 750 gosub410:ifj>127then750
  67. 760 pokez,a5:print"[147]      sorry, you didn't make it":goto790
  68. 770 pokez,a5:print"[147]      congratulations!  you won"
  69. 780 print"         your time was "mid$(ti$,3,2)":"right$(ti$,2)
  70. 790 fori=1to1000:next:pokebc,w:print"    press firebutton to play again"
  71. 800 print"          press down to quit"
  72. 810 gosub410:ifj>127thenprintspc(13)"please wait":gosub1170:goto180
  73. 820 ifjthenprint"[147]":end
  74. 830 goto810
  75. 840 rem print array
  76. 850 print"[147]    [159][161][146][161]  [161][172][162][146][190][161][146][161][161][146][161] [187][172][146] [188][187][172][146][190][161][172][187][146][187][172][172][187][146][187][161][188][161][146][161]"spc(8);
  77. 860 print"[161][146][161]  [161][188][146][187]  [187][172][146]  [161][146][161]  [161][146][161] [161][188][190][146][190][161][146][161][161][146][161][161]  [146][161]"spc(8)"[154][161][146][161]";
  78. 870 print"  [161][146][161]  [172][172][187][146][187] [161][146][161]  [161][146][161] [161][172][188][146] [161][146][161][161][146][161][161][146][161][187][146][161]"spc(8)"[188][162][162][146][190][188]";
  79. 880 print"[162][162][146][190][188][190][188][190] [162][162][146]  [188][190] [188][190][188][190] [162][162][146] [188][190][188][190]"
  80. 890 pokez,a1:printspc(4)"[194]    [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][146]    [194]"
  81. 900 printspc(4)"[194]    [194][146]";:fora=0to14:forb=0to19
  82. 910 pokez,a2:ifar$(b,a)=" "thenprintchr$(65+rnd(1)*26);:goto930
  83. 920 printar$(b,a);
  84. 930 next:pokez,a1:print"[194][146]    [194]":printspc(4);"[194]    [194][146]";:next
  85. 940 print:printspc(4)"[145][194]    [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][146]    [194]"
  86. 950 return
  87. 960 rem put words in the array
  88. 970 b=int(rnd(1)*(nw-10))
  89. 980 m=b:fora=0to9:w$=w$(b+a)
  90. 990 dr=rnd(1)*2^lv:dy=dy(dr):dx=dx(dr):l=len(w$)
  91. 1000 sx=int(rnd(1)*19+1):sy=int(rnd(1)*14+1):rx=sx:ry=sy
  92. 1010 nx=sx+(l-1)*dx:ny=sy+(l-1)*dy:ifnx<0orny<0ornx>19orny>14then990
  93. 1020 fl=0:forl=1tolen(w$):ifar$(sx,sy)<>" "thenfl=1:l=len(w$)
  94. 1030 sx=sx+dx:sy=sy+dy
  95. 1040 next:ifflthena=a-1:next
  96. 1050 forl=1tolen(w$):ar$(rx,ry)=mid$(w$,l,1)
  97. 1060 ar(rx,ry)=a+1:rx=rx+dx:ry=ry+dy:next:ln(a)=len(w$):next
  98. 1070 return
  99. 1080 rem shuffle words
  100. 1090 fora=1tonw/2:b=rnd(1)*nw:c=rnd(1)*nw:t$=w$(b):w$(b)=w$(c):w$(c)=t$
  101. 1100 next:return
  102. 1110 rem read in words
  103. 1120 dimw$(200):nw=-1
  104. 1130 nw=nw+1:readw$:fora=1tolen(w$):w$(nw)=w$(nw)+chr$(asc(mid$(w$,a,1))-1)
  105. 1140 next:ifw$(nw)<>"end"then1130
  106. 1150 return
  107. 1160 fora=0to7:readdx(a),dy(a):next
  108. 1170 fora=0to19:forb=0to14:ar$(a,b)=" ":nextb,a
  109. 1180 return
  110. 1190 data 0,1,1,0,0,-1,-1,0,-1,1,1,1,1,-1,-1,-1
  111. 1200 data dbsojwbm,djsdvt,dbobeb,vojufe,ufmfqipof,npolfz,dpnqvufs
  112. 1210 data kpztujdl,npotufs,tubqmfs,nbhjdbm,tivggmf,foe
  113.